<!DOCTYPE html>
<html>

<head>
    <title>Example</title>
    <style type="text/css">
        /* 伪类选择器--为我们基于某些共同特征选择元素提供方便
            :nth-child选择器 指定一个索引来匹配特定位置的元素
            :nth-last-child :nth-of-type :nth-last-of-type类似
        */
        body > :nth-child(2) {
            border: thin black solid;
            padding: 4px;
        }
    </style>
</head>

<body>
    <a class="class1 class2" href="http://apress.com">Visit the Apress website</a>
    <p>I like <span class="class2">apples</span> and oranges.</p>
    <a href="http://w3c.org">Visit the W3C website</a>
</body>

</html>